package com.css.dzj.dzjap.modules.lawenforcesuper.service;

import com.css.dzj.dzjap.common.util.R;
import com.css.dzj.dzjap.modules.lawenforcesuper.entity.ApSupersiveTaskInfoEntity;
import com.css.dzj.dzjap.modules.lawenforcesuper.entity.DrawTaskRelationRecordEntity;
import com.css.dzj.dzjap.modules.publick.entity.ApPublicEntity;
import com.css.dzj.dzjap.modules.record.approject.entity.ApRecordEntity;
import com.css.dzj.dzjap.modules.record.community.entity.ApRecordGainEntity;
import com.querydsl.core.QueryResults;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
 * 专家抽取service
 * @author limanman
 */
@Service
public interface SuperTaskService {

    /***
     * 保存监管任务两张表
     * @param apSupersiveTaskInfoEntity
     */
    R saveTaskInfo(String type,ApSupersiveTaskInfoEntity apSupersiveTaskInfoEntity,HttpServletRequest request);

    /***
     * 根据任务标题和类型查找任务
     * @param pageable
     * @param taskTitle
     * @param type
     * @param request
     * @return
     */
    QueryResults<ApSupersiveTaskInfoEntity> queryApSupersiveTaskInfo(Pageable pageable, String taskTitle, String type,HttpServletRequest request);


    /**
     * 根据任务和类型查找所有的任务 ---开展监管工作情况
     * @param pageable
     * @param taskTitle
     * @param type
     * @param request
     * @return
     */
    QueryResults<ApSupersiveTaskInfoEntity> queryAllApSupersiveTaskInfo(Pageable pageable, String taskTitle, String type, HttpServletRequest request);

    /***
     * 根据任务ID查找任务
     * @param taskId
     * @return
     */
    ApSupersiveTaskInfoEntity queryApSupersiveTaskInfoById(String taskId);

    /***
     * 根据任务id查找项目关联表
     * @param pageable
     * @param taskId
     * @return
     */
    QueryResults<DrawTaskRelationRecordEntity> queryTaskRelationByTaskId(Pageable pageable, String taskId);

    /***
     * 根据任务id查找项目
      * @param pageable
     * @param taskId
     * @param request
     * @return
     */
    QueryResults queryApRecord(Pageable pageable, String taskId,HttpServletRequest request);

    void updSuperTask(String taskId,String recordId);

    /**
     * 添加公告
     * @param apPublicEntity
     * @param request
     */
    void addPulic(ApPublicEntity apPublicEntity, HttpServletRequest request);

    /***
     * 根据任务id查找任务
     * @param taskId
     * @return
     */
    ApSupersiveTaskInfoEntity findById(String taskId);

    List<ApRecordEntity> findRecordById(String taskId);

    List<ApRecordGainEntity> finRecorGById(String taskId);


}
